<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="PersonneEditDlg" widgetVar="PersonneEditDialog" modal="true" resizable="false" appendToBody="true" header="#{bundle.EditPersonneTitle}">

            <h:form id="PersonneEditForm">
                <p:scrollPanel style="width:620px;height:600px" scrollMode="native">
                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" rendered="#{personneController.selected != null}">

                        <h:outputLabel value="#{bundle.EditPersonneLabel_idPersonne}" for="idPersonne" />
                        <h:outputText id="idPersonne" value="#{personneController.selected.idPersonne}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_cin}" for="cin" />
                        <p:inputText rows="4" cols="30" id="cin" value="#{personneController.selected.cin}" title="#{bundle.EditPersonneTitle_cin}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_nom}" for="nom" />
                        <p:inputText rows="4" cols="30" id="nom" value="#{personneController.selected.nom}" title="#{bundle.EditPersonneTitle_nom}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_prenom}" for="prenom" />
                        <p:inputText rows="4" cols="30" id="prenom" value="#{personneController.selected.prenom}" title="#{bundle.EditPersonneTitle_prenom}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_sexe}" for="sexe" />
                        <p:inputText rows="4" cols="30" id="sexe" value="#{personneController.selected.sexe}" title="#{bundle.EditPersonneTitle_sexe}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_dateNaissance}" for="dateNaissance" />
                        <p:calendar id="dateNaissance" pattern="MM/dd/yyyy" value="#{personneController.selected.dateNaissance}" title="#{bundle.EditPersonneTitle_dateNaissance}"  showOn="button"/>

                        <p:outputLabel value="#{bundle.EditPersonneLabel_cp}" for="cp" />
                        <p:inputText rows="4" cols="30" id="cp" value="#{personneController.selected.cp}" title="#{bundle.EditPersonneTitle_cp}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_adresse}" for="adresse" />
                        <p:inputText rows="4" cols="30" id="adresse" value="#{personneController.selected.adresse}" title="#{bundle.EditPersonneTitle_adresse}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_telephone1}" for="telephone1" />
                        <p:inputText rows="4" cols="30" id="telephone1" value="#{personneController.selected.telephone1}" title="#{bundle.EditPersonneTitle_telephone1}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_telephone2}" for="telephone2" />
                        <p:inputText rows="4" cols="30" id="telephone2" value="#{personneController.selected.telephone2}" title="#{bundle.EditPersonneTitle_telephone2}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_dateIntegration}" for="dateIntegration" />
                        <p:calendar id="dateIntegration" pattern="MM/dd/yyyy" value="#{personneController.selected.dateIntegration}" title="#{bundle.EditPersonneTitle_dateIntegration}"  showOn="button"/>

                        <p:outputLabel value="#{bundle.EditPersonneLabel_dateRdv}" for="dateRdv" />
                        <p:calendar id="dateRdv" pattern="MM/dd/yyyy" value="#{personneController.selected.dateRdv}" title="#{bundle.EditPersonneTitle_dateRdv}"  showOn="button"/>

                        <p:outputLabel value="#{bundle.EditPersonneLabel_photo}" for="photo" />
                        <p:inputText rows="4" cols="30" id="photo" value="#{personneController.selected.photo}" title="#{bundle.EditPersonneTitle_photo}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_autorisationPaternelleDAccompagnementDEnfantParNom}" for="autorisationPaternelleDAccompagnementDEnfantParNom" />
                        <p:inputText rows="4" cols="30" id="autorisationPaternelleDAccompagnementDEnfantParNom" value="#{personneController.selected.autorisationPaternelleDAccompagnementDEnfantParNom}" title="#{bundle.EditPersonneTitle_autorisationPaternelleDAccompagnementDEnfantParNom}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_autorisationPaternelleDAccompagnementDEnfantParTel}" for="autorisationPaternelleDAccompagnementDEnfantParTel" />
                        <p:inputText rows="4" cols="30" id="autorisationPaternelleDAccompagnementDEnfantParTel" value="#{personneController.selected.autorisationPaternelleDAccompagnementDEnfantParTel}" title="#{bundle.EditPersonneTitle_autorisationPaternelleDAccompagnementDEnfantParTel}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_personneCasUrgenceNom}" for="personneCasUrgenceNom" />
                        <p:inputText rows="4" cols="30" id="personneCasUrgenceNom" value="#{personneController.selected.personneCasUrgenceNom}" title="#{bundle.EditPersonneTitle_personneCasUrgenceNom}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_personneCasUrgenceTel}" for="personneCasUrgenceTel" />
                        <p:inputText rows="4" cols="30" id="personneCasUrgenceTel" value="#{personneController.selected.personneCasUrgenceTel}" title="#{bundle.EditPersonneTitle_personneCasUrgenceTel}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_enfantATIlEteEveParSesParents}" for="enfantATIlEteEveParSesParents" />
                        <p:inputText rows="4" cols="30" id="enfantATIlEteEveParSesParents" value="#{personneController.selected.enfantATIlEteEveParSesParents}" title="#{bundle.EditPersonneTitle_enfantATIlEteEveParSesParents}" />

                        <p:outputLabel value="#{bundle.EditPersonneLabel_eleveParQuiNom}" for="eleveParQuiNom" />
                        <p:inputText rows="4" cols="30" id="eleveParQuiNom" value="#{personneController.selected.eleveParQuiNom}" title="#{bundle.EditPersonneTitle_eleveParQuiNom}" />


                        <p:outputLabel value="#{bundle.EditPersonneLabel_idSituation}" for="idSituation" />
                        <p:selectOneMenu id="idSituation" value="#{personneController.selected.idSituation}" required="true" requiredMessage="#{bundle.EditPersonneRequiredMessage_idSituation}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{situationFamilialeController.items}"
                                           var="idSituationItem"
                                           itemValue="#{idSituationItem}"
                                           itemLabel="#{idSituationItem.idSituation.toString()}"
                                           />
                            <f:converter binding="#{situationFamilialeConverter}"/>
                        </p:selectOneMenu>

                        <p:outputLabel value="#{bundle.EditPersonneLabel_idPere}" for="idPere" />
                        <p:selectOneMenu id="idPere" value="#{personneController.selected.idPere}" >
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{personneController.items}"
                                           var="idPereItem"
                                           itemValue="#{idPereItem}"
                                           itemLabel="#{idPereItem.idPersonne.toString()}"
                                           />
                            <f:converter binding="#{personneConverter}"/>
                        </p:selectOneMenu>

                        <p:outputLabel value="#{bundle.EditPersonneLabel_idMere}" for="idMere" />
                        <p:selectOneMenu id="idMere" value="#{personneController.selected.idMere}" >
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{personneController.items}"
                                           var="idMereItem"
                                           itemValue="#{idMereItem}"
                                           itemLabel="#{idMereItem.idPersonne.toString()}"
                                           />
                            <f:converter binding="#{personneConverter}"/>
                        </p:selectOneMenu>

                        <p:outputLabel value="#{bundle.EditPersonneLabel_idQuartier}" for="idQuartier" />
                        <p:selectOneMenu id="idQuartier" value="#{personneController.selected.idQuartier}" required="true" requiredMessage="#{bundle.EditPersonneRequiredMessage_idQuartier}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{quartierController.items}"
                                           var="idQuartierItem"
                                           itemValue="#{idQuartierItem}"
                                           itemLabel="#{idQuartierItem.idQuartier.toString()}"
                                           />
                            <f:converter binding="#{quartierConverter}"/>
                        </p:selectOneMenu>

                        <p:outputLabel value="#{bundle.EditPersonneLabel_idProfile}" for="idProfile" />
                        <p:selectOneMenu id="idProfile" value="#{personneController.selected.idProfile}" required="true" requiredMessage="#{bundle.EditPersonneRequiredMessage_idProfile}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{profileController.items}"
                                           var="idProfileItem"
                                           itemValue="#{idProfileItem}"
                                           itemLabel="#{idProfileItem.idProfile.toString()}"
                                           />
                            <f:converter binding="#{profileConverter}"/>
                        </p:selectOneMenu>

                        <p:outputLabel value="#{bundle.EditPersonneLabel_idNiveau}" for="idNiveau" />
                        <p:selectOneMenu id="idNiveau" value="#{personneController.selected.idNiveau}" required="true" requiredMessage="#{bundle.EditPersonneRequiredMessage_idNiveau}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{scolariteController.items}"
                                           var="idNiveauItem"
                                           itemValue="#{idNiveauItem}"
                                           itemLabel="#{idNiveauItem.idNiveau.toString()}"
                                           />
                            <f:converter binding="#{scolariteConverter}"/>
                        </p:selectOneMenu>

                        <p:outputLabel value="#{bundle.EditPersonneLabel_idGroupe}" for="idGroupe" />
                        <p:selectOneMenu id="idGroupe" value="#{personneController.selected.idGroupe}" >
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{groupeController.items}"
                                           var="idGroupeItem"
                                           itemValue="#{idGroupeItem}"
                                           itemLabel="#{idGroupeItem.idGroupe.toString()}"
                                           />
                            <f:converter binding="#{groupeConverter}"/>
                        </p:selectOneMenu>

                        <p:outputLabel value="#{bundle.EditPersonneLabel_idPriseEnCharge}" for="idPriseEnCharge" />
                        <p:selectOneMenu id="idPriseEnCharge" value="#{personneController.selected.idPriseEnCharge}" required="true" requiredMessage="#{bundle.EditPersonneRequiredMessage_idPriseEnCharge}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{priseEnChargeController.items}"
                                           var="idPriseEnChargeItem"
                                           itemValue="#{idPriseEnChargeItem}"
                                           itemLabel="#{idPriseEnChargeItem.idPriseEnCharge.toString()}"
                                           />
                            <f:converter binding="#{priseEnChargeConverter}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{personneController.save}" value="#{bundle.Save}" update="display,:PersonneListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,PersonneEditDialog);"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="PersonneEditDialog.hide()"/>
                </h:panelGroup>
</p:scrollPanel>
            </h:form>

        </p:dialog>

    </ui:composition>

</html>
